<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="primus" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fc" tagdir="/WEB-INF/tags/form" %>
<%@ taglib prefix="btn" tagdir="/WEB-INF/tags/btn" %>
<primus:page title="价格列表">
    <jsp:attribute name="script">
        <script>
            $('#price-table').dataTable( {
                "ordering": true,
            } );
            $("#price-table_wrapper .row").hide();
        </script>
    </jsp:attribute>


    <jsp:body>
        <div class="breadcrumbs ace-save-state" id="breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa fa-home home-icon"></i>
                    <a href="welcome.do">
                        首页
                    </a>
                </li>
                <li>
                    商品管理
                </li>
                <li class="active">
                    价格管理
                </li>
            </ul>
        </div>
        <div class="page-content">
            <fc:form _action="management/price/list" _name="价格搜索" _buttons="false" _method="get">
                <label>门店编码</label>
                <input type="text" title="门店编码" name="depotCode" placeholder="门店编码" value="${reqVo.depotCode}" style="margin-right: 40px">
                <label>商品编码</label>
                <input type="text" title="商品编码" name="productCode" placeholder="商品编码" value="${reqVo.productCode}" style="margin-right: 40px">
                <select title="价格种类" name="priceType" style="margin-right: 10px">
                    <option selected value="">请选择价格</option>
                    <option <c:if test="${reqVo.priceType eq 'normalPrice'}" >selected</c:if> value="normalPrice">零售价</option>
                    <option <c:if test="${reqVo.priceType eq 'finalPrice'}" >selected</c:if> value="finalPrice">会员价</option>
                    <option <c:if test="${reqVo.priceType eq 'fclSinglePrice'}" >selected</c:if> value="fclSinglePrice">整箱单瓶价</option>
                    <option <c:if test="${reqVo.priceType eq 'eWalletPrice'}" >selected</c:if> value="eWalletPrice">电子钱包价</option>
                </select>
                <input type="number"  name="minPrice"  value="${reqVo.minPrice}">
                -
                <input type="number"  name="maxPrice"  value="${reqVo.maxPrice}">
                <label style="margin-right: 40px">元</label>
                <div class="inline">
                    <btn:button text="搜索" type="submit" />
                </div>
            </fc:form>
            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
                    <div class="row">
                        <div class="col-xs-12">
                            <h3 class="header smaller lighter blue">
                                价格管理 <span class="inline help-block"></span>
                            </h3>
                            <table id="price-table" class="table table-hover" >
                                <thead>
                                <tr>
                                    <th class="name">商品编码 </th>
                                    <th>商品名称</th>
                                    <th>门店编码</th>
                                    <th>零售价</th>
                                    <th>会员价</th>
                                    <th>整箱单瓶价</th>
                                    <th>电子钱包价</th>
                                    <th class="status">更新时间</th>
                                </tr>
                                </thead>
                                <tbody>
                                <c:forEach items="${pages.content}" var="item">
                                    <tr>
                                        <td><c:out value="${item.productCode}"/></td>
                                        <td><c:out value="${item.productName}"/></td>
                                        <td><c:out value="${item.depotCode}"/></td>
                                        <td><c:out value="${item.normalPrice}"/></td>
                                        <td><c:out value="${item.finalPrice}"/></td>
                                        <td><c:out value="${item.fclSinglePrice}"/></td>
                                        <td><c:out value="${item.walletPrice}"/></td>
                                        <td>
                                            <fmt:formatDate value="${item.updateTimestamp}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody><!--数据-->
                            </table>
                            <primus:springPagePagination url="management/price/list" springPage="${pages}"/>
                        </div>
                    </div>
                </div><!-- col-xs-12-->
            </div><!-- row-->
        </div>
    </jsp:body>
</primus:page>


